Name:		python3-gobject
Version:	3.42.1
Release:	1%{?dist}
Summary:	Python bindings for GLib/GObject/GIO/GTK+

License:	LGPLv2
URL:		https://wiki.gnome.org/Projects/PyGObject
Source0:	https://download.gnome.org/sources/pygobject/3.42/pygobject-%{version}.tar.xz

BuildRequires:	gobject-introspection-devel cairo-gobject-devel python3-cairo meson

%description

%global pyver 3.9
%global pylibdir /usr/lib/python%{pyver}/site-packages
%global pylib64dir %{_libdir}/python%{pyver}/site-packages

%prep
%setup -q -n pygobject-%{version}


%build
meson setup \
  --prefix %{_prefix} \
  --buildtype     plain \
  --auto-features enabled \
  --wrap-mode     nodownload \
  -D              b_lto=true \
  -D              b_pie=true \
  build
meson compile -C build

%install
meson install -C build --destdir %{buildroot}
python3 -m compileall -d /usr/lib "%{buildroot}/usr/lib"
python -O -m compileall -d /usr/lib "%{buildroot}/usr/lib"

%files
%{_includedir}/pygobject-3.0/pygobject.h
%{pylibdir}/gi/overrides
%{pylibdir}/gi/repository
%{pylibdir}/pygtkcompat
%{_libdir}/pkgconfig/pygobject-3.0.pc
%{pylib64dir}/PyGObject-3.42.1.egg-info
%{pylib64dir}/gi

%changelog

